package com.sdkj.utils;

import java.lang.reflect.ParameterizedType;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

public class ActionUtils {
	
	protected HttpServletRequest getRequest() {
		return ServletActionContext.getRequest();
	}
	
	protected HttpServletResponse getResponse() {
		return ServletActionContext.getResponse();
	}
	
	protected HttpSession getSession(){
		return ServletActionContext.getRequest().getSession();
	}
	
	protected String getSimpleClazz() {
		return (String) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0].getClass().getSimpleName();
	}

}
